<template>
	<view class="confirmOrder">
		<!-- 发货时间 -->
		<view class="delivery_time" v-if="selectedIndex!=2">
			现在至明日14:30前下单付款成功,预计明日发货!
		</view>
		<view class="top_range">
			<!-- 邮寄方式 -->
			<view class="mailing_type">
				<view class="name" v-for="(item,index) in mailType" :key="index" :data-value="index"
					@tap="buy_header_nav_event" :class="{active:selectedIndex===index}">{{item}}</view>
			</view>
			<!-- 配送范围 -->
			<view class="range_item" v-if="selectedIndex===3">
				<image src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/18/fde5145f044e4ecdbcb24b7f53c63172.png"
					mode="widthFix"></image>
				<view class="">配送范围</view>
			</view>
		</view>
		<!-- 邮寄方式内容 -->
		<view class="mailing_type_content">
			<!-- 寄 -->
			<view class="ji_item">
				<view class="mail" v-if="selectedIndex === 0 || selectedIndex === 1" @click="address_event(0)">
					<view class="ji_info">
						<view class="ji" v-if="selectedIndex === 1 || Object.keys(addressObj).length === 0">寄</view>
						<view class="xuanze_addrress" v-if="Object.keys(addressObj).length === 0">点击选择寄货地址</view>
						<view class="address" v-else>
							<view class="address_info">
								{{addressObj.provinceName}}{{addressObj.cityName}}{{addressObj.countyName}}{{addressObj.address}}
							</view>
							<view class="person_info">
								<text class="person_name">{{addressObj.name}}</text>
								<text class="person_num">{{addressObj.tel}}</text>
							</view>
						</view>
					</view>
					<view class="dayuhao">
						<image
							src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/7f41a41f8e8b45c9be9e205561a4e00b.png"
							mode="widthFix"></image>
					</view>
				</view>
				<view class="mail" v-if="selectedIndex===1" @click="address_event(1)">
					<view class="ji_info">
						<view class="shou" v-if="selectedIndex===1">收</view>
						<view class="xuanze_addrress"
							v-if="selectedIndex === 1 && Object.keys(harvestAddress).length === 0">点击选择收货地址</view>
						<view class="address" v-else>
							<view class="address_info">
								{{harvestAddress.provinceName}}{{harvestAddress.cityName}}{{harvestAddress.countyName}}{{harvestAddress.address}}
							</view>
							<view class="person_info">
								<text class="person_name">{{harvestAddress.name}}</text>
								<text class="person_num">{{harvestAddress.tel}}</text>
							</view>
						</view>
					</view>
					<view class="dayuhao" v-if="selectedIndex === 1">
						<image
							src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/7f41a41f8e8b45c9be9e205561a4e00b.png"
							mode="widthFix"></image>
					</view>
				</view>
			</view>
			<!-- 自取 -->
			<view class="ziqu_item" v-if="selectedIndex===2">
				<!-- <view class="ziqu_add">{{self_address}}</view> -->
				<view class="ziqu_add">广东省深圳市罗湖区水贝壹号2楼TL110-9</view>
				<view class="ziqu_iphone">
					<!-- <view class="kefu">{{self_name}}</view> -->
					<!-- <view class="">{{self_tel}}</view> -->
					<view class="kefu">林先生</view>
					<view class="">18221511952</view>
				</view>
			</view>
			<!-- 快递物流 -->
			<!-- <view class="express" v-if="selectedIndex !=2">
				<view class="Sf_express" v-for="(item,index) in express_list" :data-index="index"
					:data-isInsured="item.isInsured" :data-iscollect="item.isCollect" @click="express_type_envent">
					<view class="Sf_express_logo">
						<image :src="item.oss.url" mode="widthFix"></image>
					</view>
					<view class="selected-icon">
						<image :src="express_type_index === index && isCollect !== null ? select_url[1] : select_url[0]"
							mode="widthFix" />
					</view>
				</view>
			</view> -->
			<!-- 物流支付方式 logistics payment -->
			<!-- <view class="logistics_payment">
				<view class="logistics" v-if="express_type_index !== null && selectedIndex != 2">
					{{isCollect == 1 ? '寄付' : '到付'}}</view>
			</view> -->
			<!-- 保价 -->
			<!-- <view class="Insured_value" v-if="selectedIndex != 2 && isInsured == 0" @click="open()">
				<view class="Insured_value_left">
					<image src="https://www.moxikeji.com.cn/img/ruoyi/2025/01/08/4036544ee99f4ed597390d230b5561e0.png"
						mode="widthFix"></image>
					<view class="">保价</view>
				</view>
				<view class="Insured_value_right">
					<view class="">{{calculatedFeeDescription}}</view>
					<image src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/7f41a41f8e8b45c9be9e205561a4e00b.png"
						mode="widthFix"></image>
				</view>
			</view> -->
			<!-- 挂签/证书 @click="tag_certificate" -->
			<!-- <view class="tag_certificate" @click="openCertificate">
				<view class="tag_certificate_left">
					<image src="https://www.moxikeji.com.cn/img/ruoyi/2025/01/08/ac0a3a49bef04af89f50b32619020900.png"
						mode="widthFix"></image>
					<view class="">挂签/证书</view>
				</view>
				<view class="tag_certificate_right">
					<view class="">{{certificateDescription}}</view>
					<image src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/7f41a41f8e8b45c9be9e205561a4e00b.png"
						mode="widthFix"></image>
				</view>
			</view> -->
			<!-- 打字印/厂标 -->
			<!-- <view class="goods_print">
				<view class="goods_print_left">
					<image :src="marking !== null ? select_url[1]:select_url[0]" mode="widthFix"></image>
					<view class="">打字印、厂标</view>
				</view>
				<view class="goods_print_right" @click="openPrint()">
					<view class="">{{printDescription}}</view>
					<image src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/7f41a41f8e8b45c9be9e205561a4e00b.png"
						mode="widthFix"></image>
				</view>
			</view> -->
			<!-- 定单备注 -->
			<view class="type_item bj">
				<view class="baojia">
					<view class="ddbz">定单备注</view>
					<view class="ddbz_right" style="color: gray;font-size: 12px;" @click="ShowNote">
						<view class="">选填</view>
						<image
							src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/7f41a41f8e8b45c9be9e205561a4e00b.png"
							mode="widthFix"></image>
					</view>
				</view>
			</view>
			<!-- 文本框 -->
			<view class="note_content" v-if="isShowNote">
				<textarea cols="30" rows="10" maxlength="200" placeholder="请勿在备注中填写字印信息,订单备注中的字印信息字印员无法查看,存在漏打风险"
					v-model="userNote"></textarea>
			</view>
			<!-- 选购配套 -->
			<!-- <view class="goodes_purchase">
				<view class="goodes_purchase_left">
					<image src="https://www.moxikeji.com.cn/img/ruoyi/2025/01/10/a082b44ca55048119480ab747e151c38.png"
						mode="widthFix"></image>
					<view class="">选购配套</view>
				</view>
				<view class="goodes_purchase_right" @click="ShowPurchase()">
					<view class="">{{purchaseDescription}}</view>
					<image src="https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/7f41a41f8e8b45c9be9e205561a4e00b.png"
						mode="widthFix"></image>
				</view>
			</view> -->
			<!-- 配套列表 -->
			<view class="purchase_list" v-if="isShowPurchase">
				<view class="purchase_item" v-for="(item,index) in purchase_list"
					:class="{'purchase_active': selectedIndices.includes(index)}" :data-index="index"
					@click="purchase_envent">
					<image :src="item.oss.url" mode="widthFix"></image>
					<view class="purchase_item_title">{{item.tradeName}}</view>
					<view class="purchase_item_price">￥{{item.price}}</view>
					<view class="purchase_item_num">
						<view class="num_reduct" @click.stop="reduce(index)">-</view>
						<view class="num">{{userStockNums[index] || 0}}</view>
						<view class="num_add" @click.stop="add(index)">+</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 商品内容详情 -->
		<view class="goods_detail">
			<view class="" v-for="(item) in goods_items" :key="item.id">
				<view class="goodsInfo">
					<view class="goodsInfo_img">
						<image :src="item.images" mode="widthFix"></image>
					</view>
					<view class="info">
						<!-- 标题 -->
						<view class="title">
							<view class="info_name">{{item.title}}</view>
						</view>
						<view class="info_wages">重量:约{{item.goldWeight}}g</view>
						<!-- 批发工费 -->
						<view class="" v-if="item.pricingModel == '1'">
							<view class="info_wages" v-if="vipCertification==='1'">
								<view class="">{{item.wholesaleWage == null || item.wholesaleWage == '' || item.wholesaleWage == '0.00' ? '' : '工费:' + item.wholesaleWage}}</view>
								<view class="">{{item.wholesaleSurcharge == null || item.wholesaleSurcharge == '' || tem.wholesaleSurcharge == '0.00' ? '' : '附加费:' + item.wholesaleSurcharge}}</view>
								<view class="">{{item.wholesaleOtherExpenses == null || item.wholesaleOtherExpenses == '' || item.wholesaleOtherExpenses == '0.00' ? '' : '件工费:'+ item.wholesaleOtherExpenses}}</view>
							</view>
							<view class="info_wages" v-else>
								<view class="">{{item.wage == null || item.wage == '' || item.wage == '0.00' ? '' : '工费:'+ item.wage}}</view>
								<view class="">{{item.surcharge == null || item.surcharge == '' || item.surcharge == '0.00' ? '' : '附加费:' + item.surcharge}}</view>
								<view class="">{{item.otherExpenses == null || item.otherExpenses == '' || item.otherExpenses == '0.00' ? '' : '件工费:' + item.otherExpenses}}</view>
							</view>
						</view>
						<!-- 定金 -->
						<view class="jgsl">
							<view class="price">￥{{(item.price*1).toFixed(2)}}</view>
						</view>
					</view>
				</view>
			</view>
			<!-- 总计 -->
			<view class="total">
				<view class="">总计：{{group.order_base.goods_count}}件</view>
				<view class="">总金重：{{totalWeight}}g</view>
				<view class="">工费总额：{{totalwage}}</view>
			</view>
			<!-- 价格明细 -->
			<view class="price_detail">
				<view class="price_detail_title">价格明细</view>
				<view class="price_detail_item" v-if="group && group.order_base">
					<view class="">商品金额</view>
					<view class="">￥{{(group.order_base.total_price*1).toFixed(2)}}</view>
				</view>
				<!-- <view class="price_detail_item" v-if="selectedIndex != 2">
					<view class="">打包费</view>
					<view class="">￥{{balingCharges || 0}}</view>
				</view>
				<view class="price_detail_item" v-if="selectedIndex != 2 && isCollect == 1">
					<view class="">快递费</view>
					<view class="">￥{{expressFee || 0}}</view>
				</view>
				<view class="price_detail_item" v-if="selectedIndex != 2">
					<view class="">保费</view>
					<view class="">￥{{premium || 0}}</view>
				</view>
				<view class="price_detail_item">
					<view class="">证书费</view>
					<view class="">￥{{certificateFee || 0}}</view>
				</view> -->
				<!-- <view class="price_detail_item">
					<view class="">配套费</view>
					<view class="">￥{{mountingsFee || 0}}</view>
				</view> -->
				<!-- <view class="price_detail_item">
					<view class="">合计</view>
					<view class="red">￥{{totalPrice}}</view>
				</view> -->
			</view>
			<!-- 结算方式 -->
			<view class="settlement_type">
				<view class="type_item">
					<view class="type_info js">结算方式</view>
					<view class="list_price"></view>
				</view>
				<view class="type_item" v-for="(item, index) in payment_list" :key="index" :data-name="item.name" :data-value="item.id" @tap="payment_event">
					<view class="type_info">
						<!-- <image :src="item.logo" mode="widthFix"></image> -->
						<image src="https://t1.chowtaiking.com.cn/img/ruoyi/2025/03/16/e64ffc8e61e1499ea5535ce7b0f2c514.png" mode="widthFix"></image>
						<view class="type_info_zxzf">{{item.name}}</view>
					</view>
					<image :src="payment_id === item.id?select_url[1]:select_url[0]" mode="widthFix" ></image>
				</view>
			</view>
		</view>
		<!-- 底部 -->
		<view class="footer">
			<view class="footer_xy" @click="select(2)">
				<view class="footer_xy_img">
					<image :src="select_state?select_url[1]:select_url[0]" mode="widthFix" ></image>
				</view>
				<view class="footer_xy_content">
					我已阅读并同意: 因珠宝产品属于贵重物品，定单支付后，若<text class="red">非产品质量问题暂不予退换货品!</text>
					建议您对已购买的产品进行保价，未保价的包裹丢失或毁损的，不予赔偿，公司无须承担任何责任!
					省内及同省代发陆运，其他默认航空，不可更换!
				</view>
			</view>
			<view class="footer_tj">
				<view class="">共计：{{ buy_count ? buy_count : 0}}件</view>
				<view class="">合计：<text class="red">￥{{totalPrice}}</text></view>
				<view class="tj_ntb">
					<button @tap="buy_submit_event"
						:disabled="buy_submit_disabled_status">提交定单({{buy_count?buy_count:0}}件)</button>
				</view>
			</view>
		</view>
		<!-- 保价弹出层 -->
		<uni-popup ref="popup" type="bottom" :mask-click="false">
			<view class="popup_content">
				<view class="popup_sum">
					<view class="">保额</view>
					<view class="">
						<input type="number" placeholder="请输入保额" v-model="parcelInsurancePrice"
							@input="validateSumInsured" />
					</view>
				</view>
				<view class="popup_sum_sf">
					<view class="">顺丰保价</view>
				</view>
				<view class="popup_sum_sf_tip">
					顺丰最低保价10000元整,保费千分之五，最低保费6元,不满整数的余数金额将向上取整(例:1.2元将计为2元);最高暂定20万哦!
				</view>
				<view class="popup_sum_tip">
					注意：当前保费将以{{parcelInsurancePrice}}计算
				</view>
				<view class="popup_sum_text">
					*若您选择保价服务，当货物在运输途中发生丢损，保价服务商将按照声明价值和损失比列进行赔偿，赔偿金额不超过货物实际损失。未保价物品最高赔7倍运费！
				</view>
				<view class="popup_sum_computer">顺丰保费：{{ parcelInsurancePrice }} * 0.0006
					=
					<text>{{calculatedFee}}</text>
				</view>
				<view class="popup_sum_computer">合计： <text>￥{{calculatedFee}}</text> </view>
				<view class="popup_btn">
					<view class="popup_btn_bbj" @click="closeCalculatedFee()">不保价</view>
					<view class="popup_btn_bj" @click="confirmCalculatedFee()">保价</view>
				</view>
			</view>
		</uni-popup>
		<!-- 证书弹出层 -->
		<uni-popup ref="popupCertificate" type="bottom" :mask-click="false">
			<view class="popup_certificate">
				<view class="certificate_title">请选择证书</view>
				<view class="certificate_nav">
					<view class="nav_item" v-for="(item,index) in credential_list"
						:class="{'activeCertificate': certificate_index == index}" :data-index="index"
						:data-value="item.name" @click="certificate_envent">
						<image :src="item.oss.url" mode="widthFix"></image>
						<view class="">{{item.name}}</view>
						<view class="" style="color: red;">￥{{item.price}}</view>
					</view>
				</view>
				<view class="popup_btn">
					<view class="popup_btn_bbj" @click="closeCertificate()">取消</view>
					<view class="popup_btn_bj" @click="confirmSelection()">确定</view>
				</view>
			</view>
		</uni-popup>
		<!-- 打字印弹出层 -->
		<uni-popup ref="popupPrint">
			<view class="popup_print">
				<view class="popup_print_title">请输入要打印的字印</view>
				<view class="popup_print_tip">*暂无授权商标字印，如需打商标字印请先添加</view>
				<view class="popup_print_input">
					<input type="text" v-model="marking" placeholder="请输入字印内容" />
				</view>
				<view class="popup_print_out">
					<view class="">1、代打字印不支持其他元素及特殊符号, <text>只接受授权商标字印</text> </view>
					<view class="">2、为避免产品刮花或字印发黑影响产品美观, <text>金条产品默认不打字印,</text> 如您一定要打,需您自行承担可能产生的后果!</view>
				</view>
				<view class="popup_print_btn">
					<view class="popup_print_btn_close" @click="closePrint()">暂不打印</view>
					<view class="popup_print_btn_comit" @click="confirmPrint()">确定</view>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				selectedIndex: 2,
				payment_list: [],
				paymentType: "",
				mailType: ["邮寄", "代发", "自取"],
				postageType: ["邮费寄付", "邮费到付"],
				Sf_express_type: ['寄付', '到付'],
				express_list: [], //物流信息
				expressId: '',
				expressFee: 0,
				express_type: [{
						images: 'https://www.moxikeji.com.cn/img/ruoyi/2025/01/08/2fa1b5fe13af4ed59a9d9114434a8ec7.png',
						name: '顺丰快递'
					},
					{
						images: 'https://www.moxikeji.com.cn/img/ruoyi/2025/01/08/352118a9d6e346c6a3a5f0570815682d.png',
						name: "中通快递"
					}
				],
				express_type_index: null,
				premium: 0,
				parcelInsurance: null,
				calculatedFeeDescription: '寄付可享顺丰万分之四特价保费1元',
				data_list_loding_status: 1,
				buy_submit_disabled_status: false,
				data_list_loding_msg: '',
				params: null,
				payment_list: [],
				goods_list: [],
				goods_items: [],
				stock: "",
				select_url: ['https://www.moxikeji.com.cn/img/ruoyi/2023/12/18/562894ae3e19402b9267bf97789c5064.png',
					'https://www.moxikeji.com.cn/img/ruoyi/2023/12/19/f9eb824f298940dcb22b2101b3f9a6da.png'
				],
				select_state: false,
				move_state: false,
				group: {},
				address: null,
				addressObj: {},
				harvestAddress: {},
				addressType: 0,
				address_id: null,
				is_first: 1,
				payment_id: 0,
				payment_name: '',
				site_model: 2,
				plugins_use_coupon_ids: [],
				plugins_points_status: false,
				// 用户地址选择缓存key
				cache_buy_user_address_select_key: "cache_buy_user_address_select_key",
				self_address: "", //自提地址
				self_name: "", // 自提联系人
				self_tel: "", //自提联系人电话,
				buy_count: "",
				entryTime: 0,
				parcelInsurancePrice: 10000,
				credential_list: [], //证书信息
				certificateId: '',
				certificateFee: 0,
				certificate: null,
				certificate_index: null,
				certificateDescription: '权威机构 品质护航 当天出证',
				printDescription: '如需打字印,请先输入授权商标字印',
				print_index: null,
				print_list: [{
						title: 'JBH',
						statusPrint: false
					},
					{
						title: 'JLB',
						statusPrint: false
					}
				],
				marking: null,
				// 选购配套
				purchaseDescription: '首饰盒、手提袋、周边配套产品等',
				purchase_list: [],
				selectedIndices: [],
				isShowPurchase: false,
				purchase_index: null,
				isShowNote: false,
				userNote: '',
				balingCharges: 1,
				mountingsFee: 0,
				vipCertification: 0,
				productId: '',
				userStockNums: [],
				totalWeight: 0,
				isInsured: '',
				isCollect: 1,
				totalgold: 0,
				totalwage: 0,
				recipientPhone: ''
			}
		},
		// 分享给朋友
		onShareAppMessage(res) {
			return {
				title: app.globalData.data.tenantName,
				path: "pages/confirmOrder/confirmOrder?numberId=" + app.globalData.data.numberId,
				mpId: app.globalData.data.appid
			}
		},
		// 分享朋友圈
		// onShareTimeline(res) {
		// 	return{
		// 		title:app.globalData.data.tenantName,
		// 		type:0,
		// 		summary:""
		// 	}
		// },
		computed: {
			// 保价
			calculatedFee() {
				var fee = 0;
				fee = this.parcelInsurancePrice * 0.0006;
				return Math.ceil(fee);
			},
			// 总价格
			totalPrice() {
				var productPrice;
				if (this.group && this.group.order_base) {
					productPrice = parseFloat(this.group.order_base.total_price || 0);
				}
				// const balingCharges = parseFloat(this.balingCharges || 0);
				const expressFee = parseFloat(this.expressFee || 0);
				const premium = parseFloat(this.premium || 0);
				const certificateFee = parseFloat(this.certificateFee || 0);
				const mountingsFee = parseFloat(this.mountingsFee || 0);
				// 计算是否包括打包费
				const balingCharges = this.selectedIndex !== 2 ? (this.balingCharges || 0) : 0;
				// 合计
				return (productPrice + balingCharges + expressFee + premium + certificateFee + mountingsFee).toFixed(2);
			}
		},
		methods: {
			init(e) {
				var user = app.globalData.get_user_info(this, "init", "");
				if (user != false) {
					this.vipCertification = user.vipCertification;
					this.get_data();
					uni.$on("getAddress", (data) => {
						if (this.addressType === 0) {
							this.addressObj = data
							this.address_id = this.addressObj.addrId
						} else {
							this.harvestAddress = data
							this.address_id = this.harvestAddress.addrId
						}
					})
				}
			},
			OnEntryTime() {
				var radarlog_data = {
					pageUrl: "pages/confirmOrder/confirmOrder",
					name: "确认订单页面",
					remark: "确认订单页面停留时间",
					entryTime: this.entryTime,
				}
				uni.request({
					url: app.globalData.get_request_url("radarlog/add"),
					data: radarlog_data,
					method: "POST",
					success: (res) => {
						// console.log(res, "确认订单页面停留时间");
					}
				})
			},
			//自提地址
			get_data() {
				var data = {}
				uni.request({
					url: app.globalData.get_request_url("card"),
					method: "POST",
					data: data,
					success: (res) => {
						if (res.data.code == 200) {
							var data = res.data.data;
							this.self_address = data.address;
							this.self_name = data.userName;
							this.self_tel = data.tel;
						}
					}
				})
			},
			select(index) {
				if (index === 2) {
					this.select_state = !this.select_state
				} else {
					this.paymentType = index
				}
			},
			// 支付方式选择
			payment_event(e) {
				this.payment_id = e.currentTarget.dataset.value;
				this.payment_name = e.currentTarget.dataset.name;
			},
			// 获取数据
			get_init() {
				// 订单参数信息是否正确
				if (this.params == null) {
					this.data_list_loding_status = 2
					this.data_list_loding_msg = "商品信息有误"
					return false;
				}

				// 本地缓存地址
				if (this.is_first == 0) {
					var cache_address = uni.getStorageSync(this.cache_buy_user_address_select_key);
					if ((cache_address || null) != null) {
						this.address = cache_address
						this.address_id = cache_address.id
					}
				}

				// 加载loding
				uni.showLoading({
					title: '加载中...'
				});
				this.data_list_loding_status = 1
				var data = this.params;
				uni.request({
					url: app.globalData.get_request_url("buy/index"),
					method: "POST",
					data: this.request_data_ext_params_merge(data),
					success: (res) => {
						if (res.data.code == 200) {
							uni.hideLoading();
							var data = res.data.data;
							this.buy_count = data.base.buy_count
							this.payment_list = data.payment_list || [];
							this.credential_list = data.credential_list; //证书信息
							this.express_list = data.express_list; //物流信息
							this.purchase_list = data.product_list; //配套信息
							data.goods_list.forEach(group => {
								this.group = group;
								this.goods_items = group.goods_items;
								group.goods_items.forEach(item => {
									this.stock = item.stock;
									this.productId = item.goods_id;
								})
							})
							this.calculateTotalWeight();
							this.calculateTotalwage();
						} else {
							uni.showToast({
								title: res.data.msg,
								duration: 3000,
								icon: 'none'
							})
							setTimeout(() => {
								uni.navigateBack()
							}, 3000)
						}
					}
				})
			},
			// 销售工费总额
			calculateTotal(xsInfo) {
				// 批发工费
				const wage = parseFloat(xsInfo.wage);
				// 金重
				const weight = parseFloat(xsInfo.goldWeight);
				// 销售附加费
				const surcharge = parseFloat(xsInfo.surcharge);
				// 销售其他工费
				const otherExpenses = parseFloat(xsInfo.otherExpenses);

				if (!isNaN(wage) && !isNaN(weight) && !isNaN(surcharge) && !isNaN(otherExpenses)) {
					const totalCost = (wage * weight) + (surcharge * weight) + otherExpenses;
					return totalCost.toFixed(2);
				} else {
					return '0.00';
				}
			},
			// 请求参数合并
			request_data_ext_params_merge(data) {
				// 优惠券
				var coupon_ids = this.plugins_use_coupon_ids;
				if ((coupon_ids || null) != null && coupon_ids.length > 0) {
					for (var i in coupon_ids) {
						data['coupon_id_' + i] = coupon_ids[i];
					}
				}
				// 积分
				data['is_points'] = this.plugins_points_status === true ? 1 : 0;
				return data;
			},

			// 地址选择事件
			address_event(type) {
				var params = this.params;
				this.addressType = type;
				uni.navigateTo({
					url: "/pages/user-address/user-address?params=" + JSON.stringify(params)
				})
			},
			buy_header_nav_event(e) {
				this.selectedIndex = e.currentTarget.dataset.value;
				this.site_model = e.currentTarget.dataset.value;
			},
			// 快递 到付 寄付
			Sf_express_type_event(e) {
				var index = e.currentTarget.dataset.index;
				var type = e.currentTarget.dataset.type; // isCollect是否到付 1寄付，0到付
				this.isCollect = index;
			},
			// 快递类型
			express_type_envent(e) {
				var index = e.currentTarget.dataset.index;
				this.isInsured = e.currentTarget.dataset.isinsured; // isInsured是否保价  0是 ,1不是
				this.isCollect = e.currentTarget.dataset.iscollect; // isCollect是否到付  1寄付，0到付
				this.expressId = this.express_list[index]['expressId'];
				this.expressFee = this.express_list[index]['price'];
				if (this.express_type_index === index) {
					this.express_type_index = null;
					this.expressFee = 0;
				} else {
					this.express_type_index = index;
				}
				if (this.express_type_index == 1 && this.parcelInsurance != null) {
					this.calculatedFeeDescription = '寄付可享顺丰万分之四特价保费1元';
					this.parcelInsurance = 0;
					this.premium = 0;
				}
			},
			getAddress() {
				let url = app.globalData.get_request_url("useraddress/index");
				uni.request({
					url: url,
					method: "POST",
					data: this.params,
					success: (res) => {
						if (res.data.code === 200 && res.data.length > 1) {
							//默认获取第一个地址信息
							this.addressObj = res.data[0]
						}
					}
				})
			},
			// 弹出层
			open() {
				this.$refs.popup.open('bottom')
				// if (this.express_type_index == null) {
				// 	uni.showToast({
				// 		title: '请先选择快递类型',
				// 		icon: "none",
				// 		duration: 2000
				// 	})
				// 	return;
				// } else if(this.isInsured == 1){
				// 	uni.showToast({
				// 		title:'此快递不保价哦!',
				// 		icon:'none',
				// 		duration:2000
				// 	})
				// } else{
				// 	this.$refs.popup.open('bottom')
				// }
			},
			// 不保价
			closeCalculatedFee() {
				this.calculatedFeeDescription = '寄付可享顺丰万分之四特价保费1元';
				this.parcelInsurance = 0;
				this.premium = 0;
				this.$refs.popup.close();
			},
			// 保价
			confirmCalculatedFee() {
				this.calculatedFeeDescription = this.calculatedFee;
				this.premium = this.calculatedFee;
				this.parcelInsurance = 1;
				this.$refs.popup.close();
			},
			// 挂签/证书
			tag_certificate() {
				uni.navigateTo({
					url: "/pages/tag_certificate/tag_certificate"
				})
			},
			// 输入保价金额
			validateSumInsured() {
				if (this.parcelInsurancePrice < 1000) {
					this.$set(this, 'parcelInsurancePrice', 1001);
				}
			},
			// 证书弹出层
			openCertificate() {
				this.$refs.popupCertificate.open('bottom')
			},
			// 取消证书
			closeCertificate() {
				this.certificate_index = null;
				this.certificate = 0;
				this.certificateDescription = '权威机构 品质护航 当天出证';
				this.certificateFee = 0;
				this.$refs.popupCertificate.close();
			},
			// 需要证书
			confirmSelection() {
				this.certificate = 1;
				this.$refs.popupCertificate.close();
			},
			// 选择证书
			certificate_envent(e) {
				var index = e.currentTarget.dataset.index || 0;
				var value = e.currentTarget.dataset.value;
				this.certificate_index = index;
				this.certificateDescription = value;
				this.certificateId = this.credential_list[index]['certificateId'];
				this.certificateFee = this.credential_list[index]['price'];
			},
			// 打字印弹出层
			openPrint() {
				this.$refs.popupPrint.open('bottom')
			},
			// 不打字印
			closePrint() {
				this.print_index = null;
				this.marking = null;
				this.$refs.popupPrint.close();
				this.printDescription = '如需打字印,请先输入授权商标字印';
			},
			// 确定打字标
			confirmPrint() {
				this.printDescription = this.marking;
				// this.marking = this.printDescription;
				this.$refs.popupPrint.close();
			},
			print_envent(e) {
				var index = e.currentTarget.dataset.index || 0;
				var value = e.currentTarget.dataset.value;
				// 多选
				// this.print_list[index].statusPrint = !this.print_list[index].statusPrint;
				// 单选
				this.print_list.forEach((item, i) => {
					item.statusPrint = false;
				});
				this.print_list[index].statusPrint = true;
				this.print_index = index;
				this.printDescription = value;
			},
			// 选中套餐效果
			purchase_envent(e) {
				// 多选
				var index = e.currentTarget.dataset.index;
				if (this.selectedIndices.includes(index)) {
					this.selectedIndices = this.selectedIndices.filter(i => i !== index);
				} else {
					this.selectedIndices.push(index);
				}
				this.mountingsFee = this.selectedIndices.reduce((sum, index) => {
					const quantity = this.userStockNums[index] || 0;
					const price = parseFloat(this.purchase_list[index].price || 0);
					return sum + (price * quantity);
				}, 0);
			},
			// 是否显示配套
			ShowPurchase() {
				this.isShowPurchase = !this.isShowPurchase;
			},
			// 选购配套数量
			reduce(index) {
				let currentStock = this.userStockNums[index] || 0;
				if (currentStock > 0) {
					this.$set(this.userStockNums, index, currentStock - 1);
				} else {
					uni.showToast({
						title: '数量至少为1哦!',
						icon: "none",
					});
					return;
				}

				this.updateMountingsFee();
			},
			add(index) {
				let currentStock = this.userStockNums[index] || 0;
				if (currentStock < this.purchase_list[index].stock) {
					this.$set(this.userStockNums, index, currentStock + 1);
				}

				this.updateMountingsFee();
			},
			updateMountingsFee() {
				this.mountingsFee = this.selectedIndices.reduce((sum, index) => {
					const quantity = this.userStockNums[index] || 1;
					const price = parseFloat(this.purchase_list[index].price || 1);
					return sum + (price * quantity);
				}, 0);
			},
			ShowNote() {
				this.isShowNote = !this.isShowNote;
			},
			// 计算总重量
			calculateTotalWeight() {
				this.totalWeight = this.goods_items.reduce((total, item) => {
					var weight = parseFloat(item.goldWeight);
					return total + weight;
				}, 0);
				this.totalWeight = this.totalWeight.toFixed(2);
			},
			calculateTotalwage() {
				this.totalwage = this.goods_items.reduce((total, item) => {
					var wage = parseFloat(item.wage);
					return total + wage;
				}, 0);
				this.totalwage = this.totalwage.toFixed(2);
			},
			// 提交订单
			buy_submit_event() {
				// 加载loding
				uni.showLoading({
					title: '提交中...'
				});
				if (this.selectedIndex === 0) {
					if (Object.keys(this.addressObj).length === 0) {
						uni.showToast({
							title: "请选择寄货地址",
							icon: 'none',
							duration: 3000
						})
						return false;
					}
				} else {
					if (this.selectedIndex === 1) {
						if (Object.keys(this.harvestAddress).length === 0) {
							uni.showToast({
								title: "请选择收货地址",
								icon: 'none',
								duration: 3000
							})
							return false;
						}
					}
				}
				// if (this.express_type_index == null && this.selectedIndex != 2) {
				// 	uni.showToast({
				// 		title: "请选择快递方式",
				// 		icon: 'none',
				// 		duration: 3000
				// 	})
				// 	return false;
				// }
				// if (this.selectedIndex != 2 && this.parcelInsurance == null && this.isInsured == 0) {
				// 	uni.showToast({
				// 		title: "请选择是否进行保价?",
				// 		icon: 'none',
				// 		duration: 3000
				// 	})
				// 	return;
				// }
				
				
				// if (this.certificate == null) {
				// 	uni.showToast({
				// 		title: "请选择是否需要证书?",
				// 		icon: 'none',
				// 		duration: 3000
				// 	})
				// 	return;
				// }
				// if (this.marking == null) {
				// 	uni.showToast({
				// 		title: "请选择是否需要打字印?",
				// 		icon: 'none',
				// 		duration: 3000
				// 	})
				// 	return;
				// }
				if (this.payment_id === 0) {
					uni.showToast({
						title: "请选择支付方式",
						icon: 'none',
						duration: 3000
					})
					return false;
				}
				if (!this.select_state) {
					uni.showToast({
						title: "请勾选协议",
						icon: 'none',
						duration: 3000
					})
					return false;
				}
				var data = this.params;

				data['address_id'] = this.address_id;
				data['payment_id'] = this.payment_id;
				// data['user_note'] = '';
				data['site_model'] = this.site_model.toString();
				// 新增参数
				data['expressId'] = this.expressId; //快递ID
				if (this.parcelInsurance != null) {
					data['parcelInsurance'] = this.parcelInsurance.toString(); //是否保价(0不保价，1保价)
				}
				data['parcelInsurancePrice'] = this.parcelInsurancePrice; //保价金额
				data['premium'] = this.premium; //保费 
				data['expressFee'] = this.expressFee; //快递费
				data['isTsukiyori'] = this.isCollect.toString(); //是否寄付(1寄付，0到付)
				if (this.certificate) {
					data['certificate'] = this.certificate.toString(); //证书(0不需要，1需要)
				}
				data['certificateId'] = this.certificateId; //证书id
				data['certificateFee'] = this.certificateFee; //证书费
				data['balingCharges'] = this.balingCharges; //打包费
				data['mountingsFee'] = this.mountingsFee; //配套费
				data['marking'] = this.marking; //字印
				data['userNote'] = this.userNote; //用户备注
				// 配套
				let matings = [];
				this.selectedIndices.forEach(index => {
					let quantity = this.userStockNums[index] || 0;
					if (quantity > 0) {
						let selectedItem = this.purchase_list[index];
						matings.push({
							goods_id: this.productId,
							stock: quantity
						});
					}
				});
				data['matings'] = matings;
				let url = app.globalData.get_request_url("buy/add");
				uni.request({
					url: url,
					method: "POST",
					data: data,
					success: (res) => {
						if (res.data.code == 200) {
							uni.hideLoading();
							let order_status = res.data.data.order_status;
							uni.navigateTo({
								url: "/pages/user-order/user-order?order_status=" + order_status
							})
							// uni.hideLoading();
							// var data = res.data.data;
							// let order_status = data.data.order_status;
							// var orderNo = data.orderNo;
							// var totalPrice = this.totalPrice;
							// var storeOrderId = data.storeOrderId
							// var data = {
							// 	orderNo: orderNo,
							// 	totalPrice: totalPrice,
							// 	order_status: order_status,
							// 	id: storeOrderId
							// }
							// var dataStr = JSON.stringify(data);

							// uni.showToast({
							// 	title: '订单生成成功',
							// 	duration: 3000
							// })
							// setTimeout(() => {
							// 	if (this.payment_name == '转账') {
							// 		uni.navigateTo({
							// 			url: "/pages/transfer/transfer?data=" +
							// 				encodeURIComponent(dataStr)
							// 		})
							// 	} else {
							// 		uni.navigateTo({
							// 			url: "/pages/offline/offline?data=" +
							// 				encodeURIComponent(dataStr)
							// 		})
							// 	}
							// }, 3000)
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							})
							setTimeout(() => {
								uni.navigateBack()
							}, 2000)
						}
					}
				})
			}
		},
		onLoad(params) {
			if (typeof(params) != 'undefined') {
				var numberId = params.numberId || '';
				if (numberId != '') {
					uni.clearStorageSync();
					app.globalData.data.numberId = numberId;
				}
			}

			if (typeof params.data != 'undefined') {
				this.params = JSON.parse(params.data);
			}
			this.init();
		},
		onUnload() {
			this.OnEntryTime();
		},
		onShow() {
			this.get_init();
			// 记录用户进来时间
			this.entryTime = Date.now();
		}
	}
</script>

<style lang="less">
	.active {
		background-color: red;
		color: white;
	}

	.activeType {
		border: 1px solid red;
	}

	.red {
		color: red;
	}

	.confirmOrder {

		// .发货时间
		.delivery_time {
			width: 100%;
			height: 40px;
			text-align: center;
			background-color: #ffe1e1;
			color: #9b4139;
			line-height: 40px;
		}

		.top_range {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding-right: 15px;

			// 邮寄方式
			.mailing_type {
				display: flex;
				margin-top: 10px;
				margin-left: 10px;
				font-size: 12px;
				width: 180px;
				height: 25px;
				background-color: #f1f7f7;
				color: black;
				border-radius: 20px;
				line-height: 25px;

				.name {
					width: 60px;
					height: 25px;
					text-align: center;
					line-height: 25px;
					border-radius: 20px;
				}
			}

			// 配送范围
			.range_item {
				display: flex;
				align-items: center;
				font-size: 13px;
				margin-top: 10px;

				image {
					width: 25px;
				}
			}
		}

		// 邮寄方式内容
		.mailing_type_content {
			margin-top: 20px;

			// 打字印/厂标
			.goods_print {
				padding: 20rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 12px;
				border-bottom: 2px solid #f2f2f2;
				border-top: 2px solid #f2f2f2;

				.goods_print_left {
					display: flex;
					align-items: center;

					image {
						width: 40rpx;
						padding-right: 10rpx;
					}
				}

				.goods_print_right {
					color: gray;
					font-size: 11px;
					display: flex;
					align-items: center;

					image {
						width: 40rpx;
						padding-left: 10rpx;
					}
				}
			}

			// 选购配套
			.goodes_purchase {
				padding: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 2px solid #f2f2f2;

				.goodes_purchase_left {
					display: flex;
					align-items: center;
					font-size: 13px;

					image {
						width: 40rpx;
					}
				}

				.goodes_purchase_right {
					display: flex;
					align-items: center;
					color: gray;
					font-size: 12px;

					image {
						width: 40rpx;
					}
				}
			}

			// 配套列表
			.purchase_list {
				display: flex;
				overflow-x: auto;
				white-space: nowrap;
				padding-top: 20rpx;
				padding-bottom: 20rpx;
				border-bottom: 5px solid #f2f2f2;

				.purchase_active {
					border: 1px solid red;
				}

				.purchase_item {
					width: 23%;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					margin-left: 20rpx;
					flex-shrink: 0;
					padding: 10rpx;

					image {
						width: 80%;
						height: auto;
						box-shadow: 8rpx 8rpx 10rpx rgba(0, 0, 0, 0.2);
					}

					.purchase_item_title {
						width: 80%;
						font-size: 12px;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
						padding-top: 10rpx;
					}

					.purchase_item_price {
						color: red;
					}

					.purchase_item_num {
						width: 80%;
						display: flex;
						align-items: center;
						justify-content: space-between;

						.num_reduct {
							width: 30rpx;
							height: 30rpx;
							border-radius: 50%;
							border: 1px solid red;
							text-align: center;
							line-height: 30rpx;
							color: red;
						}

						.num_add {
							width: 30rpx;
							height: 30rpx;
							border-radius: 50%;
							border: 1px solid red;
							text-align: center;
							line-height: 30rpx;
							color: white;
							background-color: red;
						}
					}
				}
			}

			// 选填文本框
			.note_content {
				background-color: white;
				margin: 20rpx;
				display: flex;
				align-items: center;
				justify-content: center;

				textarea {
					width: 90%;
					background-color: #f2f2f2;
					padding: 20rpx;
					border-radius: 20rpx;
				}
			}

			.type_item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding-left: 10px;
				padding-right: 10px;
				font-size: 10px;
				border-bottom: 2px solid #f2f6f5;

				.shou {
					width: 30px;
					height: 30px;
					border-radius: 50%;
					background-color: black;
					color: white;
					text-align: center;
					line-height: 30px;
					font-size: 14px;
					margin-right: 10px;
					margin-left: 10px;
				}

				.info {
					.address_info {
						display: flex;
						margin-top: 5px;
					}

					.person_info {
						display: flex;
						margin-top: 10px;
						padding-bottom: 5px;

						.person_num {
							margin-left: 20px;
						}
					}
				}

				.dayuhao {
					image {
						width: 15px;
					}
				}

				// 顺丰
				.shunfeng {
					image {
						width: 100px;
					}
				}

				// 邮寄
				.postage {
					display: flex;
					margin-top: 10px;
					margin-left: 10px;
					font-size: 12px;
					width: 120px;
					height: 25px;
					background-color: #f1f7f7;
					color: black;
					border-radius: 20px;
					line-height: 25px;

					.postage_name {
						width: 60px;
						height: 25px;
						text-align: center;
						line-height: 25px;
						border-radius: 20px;
					}
				}

				// 保价
				.baojia {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 12px;
					font-weight: bold;

					input {
						text-align: right;
						padding-right: 20rpx;
					}

					image {
						width: 35px;
					}

					.ddbz {
						margin-right: 10px;
					}

					.ddbz_right {
						display: flex;
						align-items: center;

						image {
							width: 40rpx;
						}
					}

					.yuanquan {
						width: 20px !important;
						margin-right: 5px;
					}
				}

				// 保费
				.baofei {
					display: flex;
					align-items: center;
					font-size: 10px;

					image {
						width: 15px;
					}

					.zhuyi {
						color: gray;
					}
				}
			}

			.bj {
				height: 50px;
				border-bottom: 5px solid #f2f6f5;
			}

			.ji_item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				flex-direction: column;

				// height: 40px;
				.mail {
					width: 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;
					border-bottom: #f2f6f5 2px solid;
					padding-right: 30rpx;

					height: 80rpx;

					.ji_info {
						margin-left: 30rpx;

						.shou {
							width: 30px;
							height: 30px;
							border-radius: 50%;
							background-color: black;
							color: white;
							text-align: center;
							line-height: 30px;
							font-size: 14px;
							margin-right: 10px;
							margin-left: 10px;
						}

						.address {
							font-size: 25rpx;

						}
					}

					.dayuhao {
						image {
							width: 30rpx;
							height: 30rpx;
						}
					}
				}

				.ji_info {
					display: flex;
					align-items: center;

					.ji {
						width: 30px;
						height: 30px;
						border-radius: 50%;
						background-color: red;
						color: white;
						text-align: center;
						line-height: 30px;
						font-size: 14px;
						margin-right: 10px;
						margin-left: 10px;
					}
				}
			}

			// 自取
			.ziqu_item {
				padding-bottom: 10rpx;

				.ziqu_info {
					margin-top: 10px;
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding-left: 10px;
					padding-right: 10px;

					.ziqu_info_name {
						color: black;
						font-weight: bold;
					}

					.ziqu_info_img {
						font-size: 12px;
						color: red;
						display: flex;
						align-items: center;

						image {
							width: 15px;
						}
					}
				}

				.ziqu_add,
				.ziqu_iphone {
					font-size: 12px;
					color: black;
					padding-left: 10px;
					padding-right: 10px;
					margin-top: 5px;
				}

				.ziqu_iphone {
					display: flex;

					.kefu {
						margin-right: 20px;
					}
				}

				.ziqu_naozhong {
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding-right: 10px;
					margin-top: 10px;
					padding-bottom: 10px;
					border-bottom: 2px solid #f2f6f5;

					.naozhong {
						display: flex;
						align-items: center;
						font-size: 12px;

						.yysj {
							color: red;
						}

						image {
							width: 15px;
							margin-right: 5px;
						}
					}
				}

				.ziqu_jubao {
					display: flex;
					align-items: center;
					padding-left: 10px;
					font-size: 12px;
					border-bottom: 2px solid #f2f6f5;
					padding-top: 10px;
					padding-bottom: 10px;

					image {
						width: 60px;
						margin-right: 10px;
					}
				}
			}

			// 快递物流
			.express {
				border-bottom: 1px solid #f2f2f2;
				border-top: 1px solid #f2f2f2;
				padding-top: 10rpx;

				.Sf_express {
					position: relative;
					display: flex;
					align-items: center;
					justify-content: space-between;

					.Sf_express_logo {
						padding-left: 20rpx;

						image {
							width: 150rpx;
						}
					}

					.Sf_express_type {
						display: flex;
						margin-left: 10px;
						font-size: 12px;
						width: 120px;
						height: 25px;
						background-color: #f1f7f7;
						color: black;
						border-radius: 20px;
						line-height: 25px;
						margin-right: 40rpx;

						.Sf_express_type_item {
							width: 60px;
							height: 25px;
							line-height: 25px;
							text-align: center;
							border-radius: 40rpx;
						}
					}

					// 选中图标
					.selected-icon {
						position: absolute;
						right: 0;
						bottom: -10rpx;

						image {
							width: 40rpx;
						}
					}
				}
			}

			// .物流支付方式
			.logistics_payment {
				position: relative;

				.logistics {
					position: absolute;
					right: 0;
					margin-left: 20rpx;
					font-size: 12px;
					width: 60px;
					height: 25px;
					background-color: red;
					color: white;
					border-radius: 20px;
					line-height: 25px;
					text-align: center;
				}
			}

			// 保价
			.Insured_value {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 20rpx;
				border-bottom: 1px solid #f2f2f2;

				.Insured_value_left {
					display: flex;
					align-items: center;

					image {
						width: 50rpx;
						padding-right: 15rpx;
					}
				}

				.Insured_value_right {
					display: flex;
					align-items: center;
					color: gray;
					font-size: 12px;

					image {
						width: 40rpx;
					}
				}
			}

			// 挂签/证书
			.tag_certificate {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 20rpx;

				.tag_certificate_left {
					display: flex;
					align-items: center;

					image {
						width: 50rpx;
						padding-right: 15rpx;
					}
				}

				.tag_certificate_right {
					display: flex;
					align-items: center;
					color: gray;
					font-size: 12px;

					image {
						width: 40rpx;
					}
				}
			}
		}

		// 商品内容详情
		.goods_detail {
			padding-bottom: 50px;

			.goodsInfo {
				width: 90%;
				display: flex;
				justify-content: start;
				align-items: center;
				margin-left: 15px;
				padding-top: 10px;
				padding-bottom: 20px;
				border-bottom: 2px solid #f2f6f5;

				.goodsInfo_img {
					width: 25%;

					image {
						width: 160rpx;
						height: 160rpx;
					}
				}

				.info {
					width: 75%;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					margin-left: 10px;
					font-size: 14px;
					height: 80px;

					.title {
						display: flex;

						.fh_time {
							width: 30px;
							height: 20px;
							background-color: red;
							font-size: 8px;
							border-radius: 5px;
							color: white;
							text-align: center;
							line-height: 20px;
							margin-right: 5px;
						}

						.info_name {
							width: 100%;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
							font-size: 15px;
						}
					}

					.info_weight {
						display: flex;
						font-size: 12px;
						color: gray;

						.gold_weight {
							margin-right: 10px;
						}
					}

					// 工费
					.info_wages {
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 11px;
					}

					.jgsl {
						display: flex;
						align-items: center;
						justify-content: space-between;

						.price {
							// color: #d49373;
							color: red;
							font-size: 13px;
						}

						.num {
							width: 45px;
							height: 15px;
							line-height: 15px;
							border: 1px solid darkgray;
							display: flex;
							align-items: center;
							font-size: 10px;

							.buyNum {
								text-align: center;
								line-height: 15px;
								height: 15px;
								width: 15px;
								border-right: 1px solid darkgray;
							}
						}

					}
				}

			}

			// 总计
			.total {
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 10px;
				padding: 10px 10px 10px 10px;
				border-bottom: 5px solid #f2f6f5;
			}

			// 价格明细
			.price_detail {
				.price_detail_title {
					font-size: 17px;
					color: black;
					font-weight: bold;
					padding-left: 20rpx;
					padding-top: 20rpx;
				}

				.price_detail_item {
					display: flex;
					align-items: center;
					justify-content: space-between;
					border-bottom: 1px solid #f2f2f2;
					padding: 20rpx;
					font-size: 14px;
				}
			}

			// 结算方式
			.settlement_type {
				padding-bottom: 120px;

				.type_item {
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding-left: 6px;
					padding-right: 15px;
					margin-top: 10px;
					border-bottom: 2px solid #f2f6f5;

					image {
						width: 25px;
					}

					.type_info {
						display: flex;
						align-items: center;
						font-size: 10px !important;
						color: gray;

						.type_info_zxzf {
							color: black;
							font-size: 12px !important;
							font-weight: bold;
							padding-left: 5px;
							padding-right: 5px;
						}

						image {
							width: 40px;
						}
					}

					.js {
						font-weight: bold;
						font-size: 15px !important;
						padding-left: 9px;
						color: black;
					}
				}

				.wxts {
					width: 90%;
					height: 35px;
					line-height: 35px;
					margin: 20px auto;
					background-color: #ffe6be;
					color: black;
					font-size: 11px;
					border-radius: 5px;
					display: flex;
					padding-left: 10px;

					.qcl {
						width: 60px;
						height: 25px;
						color: white;
						background-color: #c19b5d;
						border-radius: 20px;
						text-align: center;
						line-height: 25px;
						margin-top: 5px;
						margin-left: 10px;
					}
				}
			}
		}

		// 底部
		.footer {
			position: fixed;
			bottom: 0;

			.footer_xy {
				padding-left: 5px;
				padding-right: 10px;
				display: flex;
				height: 90px;
				background-color: #ffe1e1;
				padding-top: 10px;

				.footer_xy_content {
					font-size: 13px;
				}

				.footer_xy_img {
					image {
						width: 25px;
					}
				}
			}

			.footer_tj {
				display: flex;
				align-items: center;
				justify-content: space-between;
				background-color: white;
				height: 60px;
				padding-left: 10px;
				padding-right: 10px;
				font-size: 13px;

				.tj_ntb {
					button {
						height: 40px;
						text-align: center;
						line-height: 40px;
						background-color: red;
						border-radius: 20px;
						color: white;
						font-size: 14px;
					}
				}
			}
		}
	}

	// 保价弹出层
	.popup_content {
		padding: 20rpx;
		background-color: white;
		position: fixed;
		bottom: 0;
		left: 0;

		.popup_sum {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx;
			border: 1px solid #f2f2f2;
			margin: 20rpx;
		}

		.popup_sum_sf {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx;
			border: 1px solid #f2f2f2;
			margin: 20rpx;
			background-color: #efeef3;

			.popup_sum_sf_price {
				background-color: white;
				padding: 10rpx;
			}
		}

		.popup_sum_sf_tip {
			color: gray;
			font-size: 12px;
			padding: 20rpx;
			border: 1px solid #f2f2f2;
			margin: 20rpx;
		}

		.popup_sum_tip {
			color: red;
			font-size: 13px;
			margin: 20rpx;
		}

		.popup_sum_text {
			font-size: 11px;
			color: gray;
			margin: 20rpx;
		}

		.popup_sum_computer {
			font-size: 12px;
			color: black;
			margin: 20rpx;

			text {
				color: red;
			}
		}

		.popup_btn {
			display: flex;
			align-items: center;
			justify-content: space-around;

			.popup_btn_bbj {
				width: 300rpx;
				height: 70rpx;
				border: 1px solid red;
				border-radius: 40rpx;
				color: red;
				text-align: center;
				line-height: 70rpx;
			}

			.popup_btn_bj {
				width: 300rpx;
				height: 70rpx;
				border-radius: 40rpx;
				color: white;
				text-align: center;
				line-height: 70rpx;
				background-color: red;
			}
		}
	}

	.activeCertificate {
		border: 1px solid red;
		padding: 10rpx;
		border-radius: 20rpx;
	}

	// 证书弹出层
	.popup_certificate {
		width: 100%;
		background-color: white;
		position: fixed;
		bottom: 0;
		left: 0;

		.certificate_title {
			padding-top: 20rpx;
			text-align: center;
		}

		.certificate_nav {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx;
			border-bottom: 1px dashed gray;
			background-color: white;

			.nav_item {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				font-size: 12px;

				image {
					width: 80rpx;
				}
			}
		}

		.popup_btn {
			display: flex;
			align-items: center;
			justify-content: space-around;
			margin-bottom: 40rpx;
			margin-top: 40rpx;

			.popup_btn_bbj {
				width: 300rpx;
				height: 70rpx;
				border: 1px solid red;
				border-radius: 40rpx;
				color: red;
				text-align: center;
				line-height: 70rpx;
			}

			.popup_btn_bj {
				width: 300rpx;
				height: 70rpx;
				border-radius: 40rpx;
				color: white;
				text-align: center;
				line-height: 70rpx;
				background-color: red;
			}
		}
	}

	// 打字印弹出层
	.popup_print {
		width: 100%;
		background-color: white;
		position: fixed;
		bottom: 0;
		left: 0;

		.popup_print_title {
			padding-top: 20rpx;
			text-align: center;
		}

		.popup_print_tip {
			font-size: 10px;
			color: red;
			text-align: center;
			padding-top: 20rpx;
		}

		.popup_print_input {
			padding: 20rpx;
			border: 1px solid #f2f2f2;
		}

		.popup_print_list {
			padding: 20rpx;
			border-bottom: 1px solid #f2f2f2;

			.popup_print_item {
				display: flex;
				align-items: center;
				padding-bottom: 15rpx;

				image {
					width: 40rpx;
					padding-right: 10rpx;
				}
			}
		}

		.popup_print_out {
			color: gray;
			font-size: 10px;
			padding: 20rpx;
			letter-spacing: 5rpx;

			view {
				padding-bottom: 10rpx;
			}

			text {
				color: red;
			}
		}

		.popup_print_btn {
			display: flex;
			align-items: center;
			justify-content: space-around;
			margin-bottom: 40rpx;
			margin-top: 40rpx;

			.popup_print_btn_close {
				width: 300rpx;
				height: 70rpx;
				border-radius: 40rpx;
				color: white;
				text-align: center;
				line-height: 70rpx;
				background-color: #fea500;
			}

			.popup_print_btn_comit {
				width: 300rpx;
				height: 70rpx;
				border-radius: 40rpx;
				color: white;
				text-align: center;
				line-height: 70rpx;
				background-color: red;
			}
		}
	}
</style>